import { Outlet } from "react-router-dom";
const items = [
  {
    
    label: "redux/toolkit",
    key: "0",
    router: "/demo/counterslice",
  },
  {
    label: "redux/toolkit query",
    key: "1",
    router: "/demo/apiuse",
  },
  {
    label: "dnd",
    key: "2",
    router: "/demo/dnd",
  },
  {
    label: "deepnest",
    key: "3",
    router: "/demo/deepnest",
  },
];
function Demo() {
  let navigate = useNavigate();
  const onClick = ({ key }) => {
    // 跳转对应路由
    navigate(items[key].router);
  };
  return (
    <>
      <Menu onClick={onClick} mode="horizontal" items={items} />
      <Outlet></Outlet>
    </>
  );
}
export default Demo;
